home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Hyper / D / Document Stack.cpt / Development Tools / card_2908.txt < prev    next >
Text File  |  1987-11-13  |  34KB  |  909 lines

  1. -- card: 2908 from stack: in
  2. -- bmap block id: 2479
  3. -- flags: 0000
  4. -- background id: 2662
  5. -- name: Document
  6. ----- HyperTalk script -----
  7. on Temp
  8.   global card1
  9. end Temp
  10.  
  11. on Temp2
  12.   global card1
  13. end Temp2
  14.  
  15. on mouseUp
  16.   hide card field "info"
  17. end mouseUp
  18.  
  19.  
  20. -- part 1 (button)
  21. -- low flags: 00
  22. -- high flags: A003
  23. -- rect: left=193 top=82 right=109 bottom=323
  24. -- title width / last selected line: 0
  25. -- icon id / first selected line: 0 / 0
  26. -- text alignment: 1
  27. -- font id: 0
  28. -- text size: 12
  29. -- style flags: 0
  30. -- line height: 16
  31. -- part name: Document Card
  32. ----- HyperTalk script -----
  33. on mouseUp
  34.   get fileName("STAK")
  35.   if it is empty then exit mouseUp
  36.   put it into stackName
  37.   ask "Document which card:" with "1"
  38.   if it is empty then exit mouseUp
  39.   put it into cardName
  40.  
  41.   set cursor to 4
  42.   put stackName into sName
  43.   put the length of sName into ln
  44.   if char ln of sName is ":" then delete char ln of sName
  45.   put the length of sName into ln
  46.   repeat with i=0 to ln-1
  47.     if char (ln-i) of sName is ":" then
  48.       delete char 1 to (ln-i) of sName
  49.       exit repeat
  50.     end if
  51.   end repeat
  52.   if sName is empty then exit mouseUp
  53.  
  54.   push this card
  55.   set lockMessages to true
  56.   go to card cardName of stack stackName
  57.   put "Document"&&sName&&cardName into fn
  58.  
  59.   open file fn
  60.   write "Documentation for card"&"e&cardname"e &&"of stack"&"e&stackName"e&return to file fn
  61.   write the date&&the time&return to file fn
  62.   write "========================================="&return to file fn
  63.  
  64.   put the number of buttons into bt
  65.   write "Card Buttons:"&&bt&return&return to file fn
  66.   repeat with i=1 to bt
  67.     write "Name      :"&the name of button i&return to file fn
  68.     write "Number    :"&the number of button i&return to file fn
  69.     write "ID        :"&the id of button i&return to file fn
  70.     write "Style     :"&the style of button i&return to file fn
  71.     write "Rect      :"&the rect of button i&return to file fn
  72.     write "Location  :"&the loc of button i&return to file fn
  73.     write "Icon      :"&the icon of button i&return to file fn
  74.     write "ShowName  :"&the showName of button i&return to file fn
  75.     write "Hilite    :"&the hilite of button i&return to file fn
  76.     write "AutoHilite:"&the autoHilite of button i&return to file fn
  77.     write "Visible   :"&the visible of button i&return to file fn
  78.     write "TextAlign :"&the textAlign of button i&return to file fn
  79.     write "TextFont  :"&the textFont of button i&return to file fn
  80.     write "TextSize  :"&the textSize of button i&return to file fn
  81.     write "TextStyle :"&the textStyle of button i&return to file fn
  82.     write "TextHeight:"&the textHeight of button i&return to file fn
  83.     if the script of button i <> empty then
  84.       write return&"BUTTON SCRIPT:"&return to file fn
  85.       write the script of button i to file fn
  86.       write return to file fn
  87.     end if
  88.     if i<bt then
  89.       write return to file fn
  90.       write "-----------------------------------------" to file fn
  91.       write return&return to file fn
  92.     end if
  93.   end repeat
  94.  
  95.   write "========================================="&return to file fn
  96.   put the number of background buttons into bt
  97.   write "Background Buttons:"&&bt&return&return to file fn
  98.   repeat with i=1 to bt
  99.     write "Name      :"&the name of background button i&return to file fn
  100.     write "Number    :"&the number of background button i&return to file fn
  101.     write "ID        :"&the id of background button i&return to file fn
  102.     write "Style     :"&the style of background button i&return to file fn
  103.     write "Rect      :"&the rect of background button i&return to file fn
  104.     write "Location  :"&the loc of background button i&return to file fn
  105.     write "Icon      :"&the icon of background button i&return to file fn
  106.     write "ShowName  :"&the showName of background button i&return to file fn
  107.     write "Hilite    :"&the hilite of background button i&return to file fn
  108.     write "AutoHilite:"&the autoHilite of background button i&return to file fn
  109.     write "Visible   :"&the visible of background button i&return to file fn
  110.     write "TextAlign :"&the textAlign of background button i&return to file fn
  111.     write "TextFont  :"&the textFont of background button i&return to file fn
  112.     write "TextSize  :"&the textSize of background button i&return to file fn
  113.     write "TextStyle :"&the textStyle of background button i&return to file fn
  114.     write "TextHeight:"&the textHeight of background button i&return to file fn
  115.     if the script of background button i <>empty then
  116.       write return&"BUTTON SCRIPT:"&return to file fn
  117.       write the script of background button i to file fn
  118.       write return to file fn
  119.     end if
  120.     if i<bt then
  121.       write return to file fn
  122.       write "-----------------------------------------" to file fn
  123.       write return&return to file fn
  124.     end if
  125.   end repeat
  126.  
  127.   write "========================================="&return to file fn
  128.   put the number of card fields into bt
  129.   write "Card Fields:"&&bt&return&return to file fn
  130.   repeat with i=1 to bt
  131.     write "Name       :"&the name of card field i&return to file fn
  132.     write "Number     :"&the number of card field i&return to file fn
  133.     write "ID         :"&the id of card field i&return to file fn
  134.     write "Style      :"&the style of card field i&return to file fn
  135.     write "Rect       :"&the rect of card field i&return to file fn
  136.     write "Location   :"&the loc of card field i&return to file fn
  137.     write "ShowLines  :"&the showLines of card field i&return to file fn
  138.     write "WideMargins:"&the wideMargins of card field i&return to file fn
  139.     write "LockText   :"&the lockText of card field i&return to file fn
  140.     write "Visible    :"&the visible of card field i&return to file fn
  141.     write "TextAlign  :"&the textAlign of card field i&return to file fn
  142.     write "TextFont   :"&the textFont of card field i&return to file fn
  143.     write "TextSize   :"&the textSize of card field i&return to file fn
  144.     write "TextStyle  :"&the textStyle of card field i&return to file fn
  145.     write "TextHeight :"&the textHeight of card field i&return to file fn
  146.     if the script of card field i <> empty then
  147.       write return&"FIELD SCRIPT:"&return to file fn
  148.       write the script of card field i to file fn
  149.       write return to file fn
  150.     end if
  151.     if i<bt then
  152.       write return to file fn
  153.       write "-----------------------------------------" to file fn
  154.       write return&return to file fn
  155.     end if
  156.   end repeat
  157.  
  158.   write "========================================="&return to file fn
  159.   put the number of background fields into bt
  160.   write "Background Fields:"&&bt&return&return to file fn
  161.   repeat with i=1 to bt
  162.     write "Name       :"&the name of background field i&return to file fn
  163.     write "Number     :"&the number of background field i&return to file fn
  164.     write "ID         :"&the id of background field i&return to file fn
  165.     write "Style      :"&the style of background field i&return to file fn
  166.     write "Rect       :"&the rect of background field i&return to file fn
  167.     write "Location   :"&the loc of background field i&return to file fn
  168.     write "ShowLines  :"&the showLines of background field i&return to file fn
  169.     write "WideMargins:"&the wideMargins of background field i&return to file fn
  170.     write "LockText   :"&the lockText of background field i&return to file fn
  171.     write "Visible    :"&the visible of background field i&return to file fn
  172.     write "TextAlign  :"&the textAlign of background field i&return to file fn
  173.     write "TextFont   :"&the textFont of background field i&return to file fn
  174.     write "TextSize   :"&the textSize of background field i&return to file fn
  175.     write "TextStyle  :"&the textStyle of background field i&return to file fn
  176.     write "TextHeight :"&the textHeight of background field i&return to file fn
  177.     if the script of background field i <> empty then
  178.       write return&"FIELD SCRIPT:"&return to file fn
  179.       write the script of background field i to file fn
  180.       write return to file fn
  181.     end if
  182.     if i<bt then
  183.       write return to file fn
  184.       write "-----------------------------------------" to file fn
  185.       write return&return to file fn
  186.     end if
  187.   end repeat
  188.  
  189.   write "========================================="&return to file fn
  190.   write "Card properties"&return to file fn
  191.   write "Name       :"&the name of this card&return to file fn
  192.   write "Number     :"&the number of this card&return to file fn
  193.   write "ID         :"&the id of this card&return to file fn
  194.   if the script of this card <> empty then
  195.     write return&"CARD SCRIPT:"&return to file fn
  196.     write the script of this card to file fn
  197.     write return to file fn
  198.   end if
  199.  
  200.   write "========================================="&return to file fn
  201.   write "========================================="&return to file fn
  202.   close file fn
  203.  
  204.   pop card
  205.   set lockMessages to false
  206.   put "Results put into "&fn
  207.   wait 3 seconds
  208.   hide msg
  209. end mouseUp
  210.  
  211.  
  212.  
  213. -- part 2 (button)
  214. -- low flags: 00
  215. -- high flags: A003
  216. -- rect: left=194 top=128 right=155 bottom=324
  217. -- title width / last selected line: 0
  218. -- icon id / first selected line: 0 / 0
  219. -- text alignment: 1
  220. -- font id: 0
  221. -- text size: 12
  222. -- style flags: 0
  223. -- line height: 16
  224. -- part name: Document Stack
  225. ----- HyperTalk script -----
  226. on mouseUp
  227.   global cardName
  228.   global stackName
  229.   global fn
  230.  
  231.   put " " into bNums
  232.  
  233.   get fileName("STAK")
  234.   if it is empty then exit mouseUp
  235.   put it into stackName
  236.  
  237.   set cursor to 4
  238.   push this card
  239.   set lockMessages to true
  240.   go to first card of stack stackName
  241.   put the number of cards into cardCount
  242.  
  243.   put stackName into sName
  244.   put the length of sName into ln
  245.   if char ln of sName is ":" then delete char ln of sName
  246.   put the length of sName into ln
  247.   repeat with i=0 to ln-1
  248.     if char (ln-i) of sName is ":" then
  249.       delete char 1 to (ln-i) of sName
  250.       exit repeat
  251.     end if
  252.   end repeat
  253.   if sName is empty then exit mouseUp
  254.  
  255.   repeat with cardName=1 to cardCount
  256.     go to card cardName of stack stackName
  257.     put "Document"&&sName&&cardName into fn
  258.     open file fn
  259.     write "Documentation for card"&"e&cardname"e &&"of stack"&"e&stackName"e&return to file fn
  260.     write the date&&the time&return to file fn
  261.     write "========================================="&return to file fn
  262.  
  263.     put the number of buttons into bt
  264.     write "Card Buttons:"&&bt&return&return to file fn
  265.     repeat with i=1 to bt
  266.       write "Name      :"&the name of button i&return to file fn
  267.       write "Number    :"&the number of button i&return to file fn
  268.       write "ID        :"&the id of button i&return to file fn
  269.       write "Style     :"&the style of button i&return to file fn
  270.       write "Rect      :"&the rect of button i&return to file fn
  271.       write "Location  :"&the loc of button i&return to file fn
  272.       write "Icon      :"&the icon of button i&return to file fn
  273.       write "ShowName  :"&the showName of button i&return to file fn
  274.       write "Hilite    :"&the hilite of button i&return to file fn
  275.       write "AutoHilite:"&the autoHilite of button i&return to file fn
  276.       write "Visible   :"&the visible of button i&return to file fn
  277.       write "TextAlign :"&the textAlign of button i&return to file fn
  278.       write "TextFont  :"&the textFont of button i&return to file fn
  279.       write "TextSize  :"&the textSize of button i&return to file fn
  280.       write "TextStyle :"&the textStyle of button i&return to file fn
  281.       write "TextHeight:"&the textHeight of button i&return to file fn
  282.       if the script of button i <> empty then
  283.         write return&"BUTTON SCRIPT:"&return to file fn
  284.         write the script of button i to file fn
  285.         write return to file fn
  286.       end if
  287.       if i<bt then
  288.         write return to file fn
  289.         write "-----------------------------------------" to file fn
  290.         write return&return to file fn
  291.       end if
  292.     end repeat
  293.  
  294.     write "========================================="&return to file fn
  295.     put the number of background buttons into bt
  296.     write "Background Buttons:"&&bt&return&return to file fn
  297.     repeat with i=1 to bt
  298.       write "Name      :"&the name of background button i&return to file fn
  299.       write "Number    :"&the number of background button i&return to file fn
  300.       write "ID        :"&the id of background button i&return to file fn
  301.       write "Style     :"&the style of background button i&return to file fn
  302.       write "Rect      :"&the rect of background button i&return to file fn
  303.       write "Location  :"&the loc of background button i&return to file fn
  304.       write "Icon      :"&the icon of background button i&return to file fn
  305.       write "ShowName  :"&the showName of background button i&return to file fn
  306.       write "Hilite    :"&the hilite of background button i&return to file fn
  307.       write "AutoHilite:"&the autoHilite of background button i&return to file fn
  308.       write "Visible   :"&the visible of background button i&return to file fn
  309.       write "TextAlign :"&the textAlign of background button i&return to file fn
  310.       write "TextFont  :"&the textFont of background button i&return to file fn
  311.       write "TextSize  :"&the textSize of background button i&return to file fn
  312.       write "TextStyle :"&the textStyle of background button i&return to file fn
  313.       write "TextHeight:"&the textHeight of background button i&return to file fn
  314.       if the script of background button i <>empty then
  315.         write return&"BUTTON SCRIPT:"&return to file fn
  316.         write the script of background button i to file fn
  317.         write return to file fn
  318.       end if
  319.       if i<bt then
  320.         write return to file fn
  321.         write "-----------------------------------------" to file fn
  322.         write return&return to file fn
  323.       end if
  324.     end repeat
  325.  
  326.     write "========================================="&return to file fn
  327.     put the number of card fields into bt
  328.     write "Card Fields:"&&bt&return&return to file fn
  329.     repeat with i=1 to bt
  330.       write "Name       :"&the name of card field i&return to file fn
  331.       write "Number     :"&the number of card field i&return to file fn
  332.       write "ID         :"&the id of card field i&return to file fn
  333.       write "Style      :"&the style of card field i&return to file fn
  334.       write "Rect       :"&the rect of card field i&return to file fn
  335.       write "Location   :"&the loc of card field i&return to file fn
  336.       write "ShowLines  :"&the showLines of card field i&return to file fn
  337.       write "WideMargins:"&the wideMargins of card field i&return to file fn
  338.       write "LockText   :"&the lockText of card field i&return to file fn
  339.       write "Visible    :"&the visible of card field i&return to file fn
  340.       write "TextAlign  :"&the textAlign of card field i&return to file fn
  341.       write "TextFont   :"&the textFont of card field i&return to file fn
  342.       write "TextSize   :"&the textSize of card field i&return to file fn
  343.       write "TextStyle  :"&the textStyle of card field i&return to file fn
  344.       write "TextHeight :"&the textHeight of card field i&return to file fn
  345.       if the script of card field i <> empty then
  346.         write return&"FIELD SCRIPT:"&return to file fn
  347.         write the script of card field i to file fn
  348.         write return to file fn
  349.       end if
  350.       if i<bt then
  351.         write return to file fn
  352.         write "-----------------------------------------" to file fn
  353.         write return&return to file fn
  354.       end if
  355.     end repeat
  356.  
  357.     write "========================================="&return to file fn
  358.     put the number of background fields into bt
  359.     write "Background Fields:"&&bt&return&return to file fn
  360.     repeat with i=1 to bt
  361.       write "Name       :"&the name of background field i&return to file fn
  362.       write "Number     :"&the number of background field i&return to file fn
  363.       write "ID         :"&the id of background field i&return to file fn
  364.       write "Style      :"&the style of background field i&return to file fn
  365.       write "Rect       :"&the rect of background field i&return to file fn
  366.       write "Location   :"&the loc of background field i&return to file fn
  367.       write "ShowLines  :"&the showLines of background field i&return to file fn
  368.       write "WideMargins:"&the wideMargins of background field i&return to file fn
  369.       write "LockText   :"&the lockText of background field i&return to file fn
  370.       write "Visible    :"&the visible of background field i&return to file fn
  371.       write "TextAlign  :"&the textAlign of background field i&return to file fn
  372.       write "TextFont   :"&the textFont of background field i&return to file fn
  373.       write "TextSize   :"&the textSize of background field i&return to file fn
  374.       write "TextStyle  :"&the textStyle of background field i&return to file fn
  375.       write "TextHeight :"&the textHeight of background field i&return to file fn
  376.       if the script of background field i <> empty then
  377.         write return&"FIELD SCRIPT:"&return to file fn
  378.         write the script of background field i to file fn
  379.         write return to file fn
  380.       end if
  381.       if i<bt then
  382.         write return to file fn
  383.         write "-----------------------------------------" to file fn
  384.         write return&return to file fn
  385.       end if
  386.     end repeat
  387.  
  388.     write "========================================="&return to file fn
  389.     write "Card properties"&return to file fn
  390.     write "Name       :"&the name of this card&return to file fn
  391.     write "Number     :"&the number of this card&return to file fn
  392.     write "ID         :"&the id of this card&return to file fn
  393.     if the script of this card <> empty then
  394.       write return&"CARD SCRIPT:"&return to file fn
  395.       write the script of this card to file fn
  396.       write return to file fn
  397.     end if
  398.  
  399.     write "========================================="&return to file fn
  400.     write "Background properties"&return to file fn
  401.     write "Name       :"&the name of this background&return to file fn
  402.     write "Number     :"&the number of this background&return to file fn
  403.     write "ID         :"&the id of this background&return to file fn
  404.     if the script of this background <> empty then
  405.       put the number of this background into bNum
  406.       put the number of items of bNums into nItems
  407.       repeat with k=1 to nItems+1
  408.         if bNum=item k of bNums then exit repeat
  409.       end repeat
  410.       if k=nItems+1 then
  411.         put bNum into item k of bNums
  412.         write return&"BACKGROUND SCRIPT:"&return to file fn
  413.         write the script of this background to file fn
  414.         write return to file fn
  415.       else
  416.         write return&"BACKGROUND SCRIPT: Same as in prior card"&return to file fn
  417.       end if
  418.     end if
  419.  
  420.     write "========================================="&return to file fn
  421.     write "========================================="&return to file fn
  422.     close file fn
  423.  
  424.   end repeat
  425.   pop card
  426.   set lockMessages to false
  427.   put "Results put into "&sName&"..."
  428.   wait 3 seconds
  429.   hide msg
  430. end mouseUp
  431.  
  432.  
  433.  
  434. -- part 5 (button)
  435. -- low flags: 00
  436. -- high flags: 0003
  437. -- rect: left=460 top=26 right=66 bottom=506
  438. -- title width / last selected line: 0
  439. -- icon id / first selected line: 1011 / 1011
  440. -- text alignment: 1
  441. -- font id: 0
  442. -- text size: 12
  443. -- style flags: 0
  444. -- line height: 16
  445. -- part name: 
  446. ----- HyperTalk script -----
  447. on mouseUp
  448.   go to home
  449. end mouseUp
  450.  
  451.  
  452.  
  453. -- part 6 (button)
  454. -- low flags: 00
  455. -- high flags: A003
  456. -- rect: left=194 top=176 right=203 bottom=324
  457. -- title width / last selected line: 0
  458. -- icon id / first selected line: 0 / 0
  459. -- text alignment: 1
  460. -- font id: 0
  461. -- text size: 12
  462. -- style flags: 0
  463. -- line height: 16
  464. -- part name: Document Globals
  465. ----- HyperTalk script -----
  466. on mouseUp
  467.   get fileName("STAK")
  468.   if it is empty then exit mouseUp
  469.   put it into stackName
  470.  
  471.   put " " into bNums
  472.   put "card button,background button,card field,background field" into nm
  473.   put "Card button,Background button,Card field,Background field" into nmCap
  474.   set cursor to 4
  475.   push this card
  476.   set lockMessages to true
  477.   go to first card of stack stackName
  478.   put the number of cards into cardCount
  479.  
  480.   put stackName into sName
  481.   put the length of sName into ln
  482.   if char ln of sName is ":" then delete char ln of sName
  483.   put the length of sName into ln
  484.   repeat with i=0 to ln-1
  485.     if char (ln-i) of sName is ":" then
  486.       delete char 1 to (ln-i) of sName
  487.       exit repeat
  488.     end if
  489.   end repeat
  490.   if sName is empty then exit mouseUp
  491.  
  492.   put "Global"&&sName into fn
  493.   open file fn
  494.   write "Global variables for stack"&"e&stackName"e&return to file fn
  495.   write the date&&the time&return to file fn
  496.   write "========================================="&return to file fn
  497.  
  498.   repeat with cardName=1 to cardCount
  499.     go to card cardName of stack stackName
  500.  
  501.     repeat with type=1 to 4
  502.       do "put the number of "&item type of nm&"s into bt"
  503.       repeat with i=1 to bt
  504.         put item type of nmCap&&i
  505.         do "put the script of "&item type of nm&" i into tmp"
  506.  
  507.         if tmp <> empty then
  508.           put true into firstFlag
  509.           put item 1 of find(tmp,"<global") into lastPos
  510.           if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  511.             put 0 into lastPos
  512.           end if
  513.           if (lastPos>0) then
  514.             put false into firstFlag
  515.             write item type of nmCap&&i&&"of card"&&cardName to file fn
  516.             do "put the name of "&item type of nm&" i into name"
  517.             if name is empty then
  518.               write return to file fn
  519.             else
  520.               write " ("&name&")"&return to file fn
  521.             end if
  522.           end if
  523.           repeat until (lastPos=0)
  524.             write "   "&word 2 of line lastPos of tmp&return to file fn
  525.             put item 1 of find(tmp,"<global",lastPos) into lastPos
  526.             if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  527.               put 0 into lastPos
  528.             end if
  529.           end repeat
  530.         end if
  531.  
  532.         if firstFlag is false then
  533.           write "-----------------------------------------" to file fn
  534.           write return to file fn
  535.         end if
  536.       end repeat
  537.     end repeat
  538.  
  539.  
  540.     put "Card"&&cardName
  541.     put true into firstFlag
  542.     put the script of this card into tmp
  543.  
  544.     if tmp <> empty then
  545.       put true into firstFlag
  546.       put item 1 of find(tmp,"<global") into lastPos
  547.       if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  548.         put 0 into lastPos
  549.       end if
  550.       if (lastPos>0) then
  551.         put false into firstFlag
  552.         write "Card"&&cardName to file fn
  553.         put the name of this card into name
  554.         if name is empty then
  555.           write return to file fn
  556.         else
  557.           write " ("&name&")"&return to file fn
  558.         end if
  559.       end if
  560.       repeat until (lastPos=0)
  561.         write "   "&word 2 of line lastPos of tmp&return to file fn
  562.         put item 1 of find(tmp,"<global",lastPos) into lastPos
  563.         if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  564.           put 0 into lastPos
  565.         end if
  566.       end repeat
  567.     end if
  568.  
  569.     if firstFlag is false then
  570.       write "-----------------------------------------" to file fn
  571.       write return to file fn
  572.     end if
  573.  
  574.  
  575.     put "Background for card"&&cardName
  576.     put true into firstFlag
  577.     if the script of this background <> empty then
  578.       put the number of this background into bNum
  579.  
  580.       put find(bNums,bNum) into bNumLoc
  581.       if bNumLoc=0 then
  582.         put bNum&"," after bNums
  583.         put the script of this background into tmp
  584.  
  585.         put true into firstFlag
  586.         put item 1 of find(tmp,"<global") into lastPos
  587.         if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  588.           put 0 into lastPos
  589.         end if
  590.         if (lastPos>0) then
  591.           put false into firstFlag
  592.           write "Background for card"&&cardName to file fn
  593.           put the name of this background into name
  594.           if name is empty then
  595.             write return to file fn
  596.           else
  597.             write " ("&name&")"&return to file fn
  598.           end if
  599.         end if
  600.         repeat until (lastPos=0)
  601.           write "   "&word 2 of line lastPos of tmp&return to file fn
  602.           put item 1 of find(tmp,"<global",lastPos) into lastPos
  603.           if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  604.             put 0 into lastPos
  605.           end if
  606.         end repeat
  607.       end if
  608.  
  609.       if firstFlag is false then
  610.         write "-----------------------------------------" to file fn
  611.         write return to file fn
  612.       end if
  613.     end if
  614.  
  615.   end repeat
  616.  
  617.  
  618.   put "Stack"
  619.   put true into firstFlag
  620.   put the script of this stack into tmp
  621.  
  622.   if tmp <> empty then
  623.     put true into firstFlag
  624.     put item 1 of find(tmp,"<global") into lastPos
  625.     if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  626.       put 0 into lastPos
  627.     end if
  628.     if (lastPos>0) then
  629.       put false into firstFlag
  630.       write "Stack"&&sName&return to file fn
  631.     end if
  632.     repeat until (lastPos=0)
  633.       write "   "&word 2 of line lastPos of tmp&return to file fn
  634.       put item 1 of find(tmp,"<global",lastPos) into lastPos
  635.       if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  636.         put 0 into lastPos
  637.       end if
  638.     end repeat
  639.   end if
  640.  
  641.   if firstFlag is false then
  642.     write "-----------------------------------------" to file fn
  643.     write return to file fn
  644.   end if
  645.  
  646.  
  647.   pop card
  648.   close file fn
  649.   set lockMessages to false
  650.   put "Results put into "&fn
  651.   wait 3 seconds
  652.   hide msg
  653. end mouseUp
  654.  
  655.  
  656.  
  657. -- part 8 (button)
  658. -- low flags: 00
  659. -- high flags: A003
  660. -- rect: left=194 top=224 right=251 bottom=324
  661. -- title width / last selected line: 0
  662. -- icon id / first selected line: 0 / 0
  663. -- text alignment: 1
  664. -- font id: 0
  665. -- text size: 12
  666. -- style flags: 0
  667. -- line height: 16
  668. -- part name: Global XRef
  669. ----- HyperTalk script -----
  670. on mouseUp
  671.   get fileName("STAK")
  672.   if it is empty then exit mouseUp
  673.   put it into stackName
  674.  
  675.   put " " into bNums
  676.   put "card button,background button,card field,background field" into nm
  677.   put "Card button,Background button,Card field,Background field" into nmCap
  678.   set cursor to 4
  679.   push this card
  680.   set lockMessages to true
  681.   set lockScreen to true
  682.   go to first card of stack stackName
  683.   put the number of cards into cardCount
  684.  
  685.   put stackName into sName
  686.   put the length of sName into ln
  687.   if char ln of sName is ":" then delete char ln of sName
  688.   put the length of sName into ln
  689.   repeat with i=0 to ln-1
  690.     if char (ln-i) of sName is ":" then
  691.       delete char 1 to (ln-i) of sName
  692.       exit repeat
  693.     end if
  694.   end repeat
  695.   if sName is empty then exit mouseUp
  696.  
  697.  
  698.   repeat with cardNum=1 to cardCount
  699.     go to card cardNum
  700.  
  701.     put the name of this card into cardName
  702.     if cardName is empty then
  703.       put "card"&&cardNum into cardName
  704.     end if
  705.  
  706.     repeat with type=1 to 4
  707.       do "put the number of "&item type of nm&"s into bt"
  708.       repeat with i=1 to bt
  709.         put item type of nmCap&&i
  710.         do "put the script of "&item type of nm&" i into tmp"
  711.  
  712.         if tmp <> empty then
  713.           put item 1 of find(tmp,"<global") into lastPos
  714.           if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  715.             put 0 into lastPos
  716.           end if
  717.           if (lastPos>0) then
  718.             do "put the name of "&item type of nm&" i into name"
  719.             if name is empty then
  720.               put item type of nmCap&&i&&"of"&&cardName&return into name
  721.             else
  722.               put name&&"of"&&cardName&return into name
  723.             end if
  724.           end if
  725.           repeat until (lastPos=0)
  726.             put word 2 of line lastPos of tmp&&name after xref
  727.             put item 1 of find(tmp,"<global",lastPos) into lastPos
  728.             if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  729.               put 0 into lastPos
  730.             end if
  731.           end repeat
  732.         end if
  733.  
  734.       end repeat
  735.     end repeat
  736.  
  737.  
  738.     put cardName
  739.     put the script of this card into tmp
  740.  
  741.     if tmp <> empty then
  742.       put item 1 of find(tmp,"<global") into lastPos
  743.       if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  744.         put 0 into lastPos
  745.       end if
  746.       if (lastPos>0) then
  747.         put the name of this card into name
  748.         if name is empty then
  749.           put "Card"&&cardNum&return into name
  750.         else
  751.           put name&return into name
  752.         end if
  753.       end if
  754.       repeat until (lastPos=0)
  755.         put word 2 of line lastPos of tmp&&name after xref
  756.         put item 1 of find(tmp,"<global",lastPos) into lastPos
  757.         if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  758.           put 0 into lastPos
  759.         end if
  760.       end repeat
  761.     end if
  762.  
  763.  
  764.     put "Background for card"&&cardNum
  765.     if the script of this background <> empty then
  766.       put the number of this background into bNum
  767.  
  768.       put find(bNums,bNum) into bNumLoc
  769.       if bNumLoc=0 then
  770.         put bNum&"," after bNums
  771.         put the script of this background into tmp
  772.  
  773.         put true into firstFlag
  774.         put item 1 of find(tmp,"<global") into lastPos
  775.         if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  776.           put 0 into lastPos
  777.         end if
  778.         if (lastPos>0) then
  779.           put the name of this background into name
  780.           if name is empty then
  781.             put "Background for card"&&cardNum into name
  782.           else
  783.             put name&return into name
  784.           end if
  785.         end if
  786.         repeat until (lastPos=0)
  787.           put word 2 of line lastPos of tmp&&name after xref
  788.           put item 1 of find(tmp,"<global",lastPos) into lastPos
  789.           if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  790.             put 0 into lastPos
  791.           end if
  792.         end repeat
  793.       end if
  794.     end if
  795.  
  796.   end repeat
  797.  
  798.  
  799.   put "Stack"
  800.   put the script of this stack into tmp
  801.  
  802.   if tmp <> empty then
  803.     put item 1 of find(tmp,"<global") into lastPos
  804.     if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  805.       put 0 into lastPos
  806.     end if
  807.     put "Stack"&&sName&return into name
  808.     repeat until (lastPos=0)
  809.       put word 2 of line lastPos of tmp&&name after xref
  810.       put item 1 of find(tmp,"<global",lastPos) into lastPos
  811.       if (lastPos>0) and (word 1 of line lastPos of tmp<>"global") then
  812.         put 0 into lastPos
  813.       end if
  814.     end repeat
  815.   end if
  816.  
  817.   put "Sorting cross reference list"
  818.   put "Global"&&sName into fn
  819.   open file fn
  820.   write "Global variables for stack"&"e&stackName"e&return to file fn
  821.   write the date&&the time&return to file fn
  822.   write "========================================="&return to file fn
  823.  
  824.   put sort(xref,"a") into xref
  825.   put the number of lines of xref into nLines
  826.   put empty into lastGlobal
  827.   put empty into lastItem
  828.   repeat with i=1 to nLines
  829.     put line i of xref into tmp
  830.     put word 1 of tmp into tmp1
  831.     if tmp1 <> lastGlobal then
  832.       write tmp1&return to file fn
  833.       put tmp1 into lastGlobal
  834.       put empty into lastItem
  835.     end if
  836.     delete word 1 of tmp
  837.     if tmp <> lastItem then
  838.       write "   "&tmp&return to file fn
  839.       put tmp into lastItem
  840.     end if
  841.   end repeat
  842.  
  843.   pop card
  844.   close file fn
  845.   set lockScreen to false
  846.   set lockMessages to false
  847.   put "Results put into "&fn
  848.   wait 3 seconds
  849.   hide msg
  850. end mouseUp
  851.  
  852.  
  853.  
  854. -- part 14 (button)
  855. -- low flags: 00
  856. -- high flags: 2003
  857. -- rect: left=8 top=26 right=66 bottom=54
  858. -- title width / last selected line: 0
  859. -- icon id / first selected line: 2478 / 2478
  860. -- text alignment: 1
  861. -- font id: 0
  862. -- text size: 12
  863. -- style flags: 0
  864. -- line height: 16
  865. -- part name: 
  866. ----- HyperTalk script -----
  867. on mouseUp
  868.   show card field "info"
  869. end mouseUp
  870.  
  871.  
  872.  
  873. -- part 15 (field)
  874. -- low flags: 81
  875. -- high flags: 2007
  876. -- rect: left=73 top=50 right=335 bottom=428
  877. -- title width / last selected line: 0
  878. -- icon id / first selected line: 0 / 0
  879. -- text alignment: 0
  880. -- font id: 3
  881. -- text size: 10
  882. -- style flags: 0
  883. -- line height: 13
  884. -- part name: info
  885.  
  886.  
  887. -- part contents for card part 15
  888. ----- text -----
  889. This stack was written as an aid to HyperTalk programmers. It produces:
  890.  
  891. ‚Ä¢ Complete documentation of a card or a stack
  892. ‚Ä¢ Lists of global variables in a stack
  893. ‚Ä¢ Sorted global variable cross-reference list
  894.  
  895. This stack can be used and distributed freely as long it is not modified or sold for a profit.
  896.  
  897. This stack makes use of a pair of external functions for finding a string in a container and sorting a container. These externals are not public domain and cannot be used apart from this stack without the expressed written consent of the authors.  A non-commercial  license is available for these functions for $10. Inexpensive commercial licenses are also available. Write for details.
  898.  
  899. Copyright 1987 Boojum Computer Systems, Inc.
  900. All Commercial Rights Reserved
  901.  
  902. Hints for use:
  903.  
  904. Both global listings and cross-references require the use of an external function to find the word global in a script.  The cross references further require a sort function. Both of these are included in this stack and so the stack will work correctly without modification. The problem is that when examining another stack, HyperCard does not save these functions in memory, but continually pops back to the Development Tools stack to retreive these functions. This process slows the processing of the stack being analyzed to a snail's pace, not to mention the wear and tear on your hard disk. The solution is to first use ResEdit to copy these two  XFCNs to your copy of HyperCard and then to delete the functions from this stack. The functions will then be available to the system without excessive disk accesses. 
  905.  
  906. Rick Chapman and Andy Scheck
  907. Boojum Computer Systems, Inc.
  908. 15004 Donna Drive
  909.  Silver Spring, Md 20904                                November 1, 1987